var current_uid='';

function keepalive(){

	$.post("/index.php/auth/checklogin",
			  {
				uid:current_uid
			  },			  
			function(returnData) { 
				console.log("keepalive returnData:",returnData);
				console.log("keepalive current_uid:",current_uid);
				if(current_uid==''){
					current_uid=returnData.uid;
					return;
				}
				if(returnData.status){					
					current_uid = returnData.uid;
				}else{					
					layer.alert('你长时间未操作，已经退出登录状态了，页面将刷新！', {icon: 3}, function(index){
						layer.close(index);
						window.location.reload();
					});
				}; 
			},"json");	
}

$(document).ready(function() {  
	 setInterval("keepalive()", 1000*60); 
}); 